$(function () {

})
function loadData(num) {
    console.log(num);
        //ajax请求后，有了count~重新赋值
        $.ajax({
            url:"front/article/articlePageList.do",
            type:"POST",
            async:false,
            data:{articleType:1,pageNum:10,currentPage:num},
            dataType:"JSON",
            success:function (json) {
                if (json.code==1){
                    $("#form1").children().remove();
                    $(".news-img2").children().remove()
                    $("body").css("width", $(window).width());
                    
                    $(json.articleList).each(function (i,o) {
                        if (i>0) {
                             var dd=o.content.replace(/<\/?.+?>/g,"");
                            var dds=dd.replace(/ /g,"");//dds为得到后的内容
                            var div = $("<a href='front/article/articleDetail/"+o.articleId+".do?articleType=1'><div class='news-card' ><div class='news-cardtitle'><span class='nes-card-mtitle'>"+o.articleName+"</span><span class='nes-card-mdata'>"+o.releaseTimeStr+"</span><div class='news-content'>"+dds+"</div></div><a href='front/article/articleDetail/"+o.articleId+".do?articleType=1'></a></div></a><div class='news-hrdiv'><hr></div>").appendTo("#form1");
                            
                        }else{
                            var dd=o.content.replace(/<\/?.+?>/g,"");
                            var dds=dd.replace(/ /g,"");//dds为得到后的内容
                            var div2 = $("<div style='width: 590px;height: 270px;'><img src='././static/img/new2.png'></div><div class='newImgTitle1'><div class='news-zx'><span class='news2-zx'><span class='news1-zx'>[最新]</span>"+o.articleName+"</span></div><div class='clock-img'><img src='././static/img/clock.png'><span class='clock-time'>"+o.releaseTimeStr+"</span></div><div class='news-content'>"+dds+"</div><a href='front/article/articleDetail/"+o.articleId+".do?articleType=1'><button class='news-more'>查看更多</button></a></div>").appendTo(".news-img2");
                        }
                        
                    })
                    $(".news-hrdiv:last").remove();
                    $("#PageCount").val(json.articleCount);
                }else{

                }
            }
        })
}
